<template>
	<div class="detailView">
		<div class="bottomView">
			<el-button type="primary" @click="back">返回</el-button>
			<div class="detail">
				<h4>用户名:</h4>
				<span>{{ newslist.userName }}</span>
			</div>
			<div class="detail">
				<h4>电话:</h4>
				<span>{{ newslist.userPhone }}</span>
			</div>
			<div class="detail">
				<h4>地址:</h4>
				<span>{{ adress  }}</span>
			</div>
		</div>

	</div>
</template>

<script>
export default {
	data() {
		return {
			baseUrl: require("../assets/baseUrl.js").baseUrl,
			newslist: [],
			adress: "",
		}
	},
	methods: {
		back() {
			this.$router.push('/staticsproject/statistics')
		},
		getnews() {
			/* http://localhost:8081/user/find */
			this.$http.post(this.baseUrl + "user/find", {
				userId: this.$route.query.userId
			}).then(res => {
			/* 	console.log(res) */
				if (res.data.code == 200) {
					this.newslist = res.data.data
					if (res.data.data.address!="") {
						let arr = res.data.data.address
						for (let i = 0; i < arr.length; i++) {
							if (arr[i].isDefault == 1) {
								this.adress = arr[i].addressContent
							}
						}
					}else{
						this.adress="无"
					}


				}
			})
		},
	},
	mounted() {
		this.getnews()
	}
}
</script>

<style lang="less">
.detailView {
	display: flex;
	flex-direction: column;

	.bottomView {
		display: flex;
		flex-direction: column;
		width: 80vw;
		margin-left: 30px;

		.el-button {
			width: 80px;
			height: 40px;
			margin-bottom: 20px;
			font-size: 20px;
			border-radius: 10px;
			line-height: 15px;
		}

		.detail {
			display: flex;
			line-height: 45px;

			h4 {
				font-size: 24px;
				width: 100px;
				text-align: left;
			}

			span {
				font-size: 20px;
				color: #999;
			}
		}
	}

}
</style>